﻿using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;

namespace Element.UI
{
    public class ElButton : Button
    {
        #region Dependency Properites
        // Using a DependencyProperty as the backing store for BackgroundMouseOver.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty BackgroundMouseOverProperty =
            DependencyProperty.Register("BackgroundMouseOver", typeof(Brush), typeof(ElButton), new PropertyMetadata(null));

        // Using a DependencyProperty as the backing store for BackgroundPressed.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty BackgroundPressedProperty =
            DependencyProperty.Register("BackgroundPressed", typeof(Brush), typeof(ElButton), new PropertyMetadata(null));

        // Using a DependencyProperty as the backing store for ForegroundMouseOver.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty ForegroundMouseOverProperty =
            DependencyProperty.Register("ForegroundMouseOver", typeof(Brush), typeof(ElButton), new PropertyMetadata(null));

        // Using a DependencyProperty as the backing store for ForegroundPressed.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty ForegroundPressedProperty =
            DependencyProperty.Register("ForegroundPressed", typeof(Brush), typeof(ElButton), new PropertyMetadata(null));

        // Using a DependencyProperty as the backing store for Icon.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty IconProperty =
            DependencyProperty.Register("Icon", typeof(object), typeof(ElButton), new PropertyMetadata(null));

        // Using a DependencyProperty as the backing store for IconMouseOver.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty IconMouseOverProperty =
            DependencyProperty.Register("IconMouseOver", typeof(object), typeof(ElButton), new PropertyMetadata(null));

        // Using a DependencyProperty as the backing store for IconPressed.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty IconPressedProperty =
            DependencyProperty.Register("IconPressed", typeof(object), typeof(ElButton), new PropertyMetadata(null));



        public double IconWidth
        {
            get { return (double)GetValue(IconWidthProperty); }
            set { SetValue(IconWidthProperty, value); }
        }

        // Using a DependencyProperty as the backing store for IconWidth.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty IconWidthProperty =
            DependencyProperty.Register("IconWidth", typeof(double), typeof(ElButton), new PropertyMetadata(double.NaN));

        public double IconHeight
        {
            get { return (double)GetValue(IconHeightProperty); }
            set { SetValue(IconHeightProperty, value); }
        }

        // Using a DependencyProperty as the backing store for IconHeight.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty IconHeightProperty =
            DependencyProperty.Register("IconHeight", typeof(double), typeof(ElButton), new PropertyMetadata(double.NaN));


        public Orientation ContnetOrientation
        {
            get { return (Orientation)GetValue(ContnetOrientationProperty); }
            set { SetValue(ContnetOrientationProperty, value); }
        }

        // Using a DependencyProperty as the backing store for ContnetOrientation.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty ContnetOrientationProperty =
            DependencyProperty.Register("ContnetOrientation", typeof(Orientation), typeof(ElButton), new PropertyMetadata(Orientation.Horizontal));

        #endregion

        #region Properties

        public Brush BackgroundPressed
        {
            get { return (Brush)GetValue(BackgroundPressedProperty); }
            set { SetValue(BackgroundPressedProperty, value); }
        }

        public Brush BackgroundMouseOver
        {
            get { return (Brush)GetValue(BackgroundMouseOverProperty); }
            set { SetValue(BackgroundMouseOverProperty, value); }
        }
        public Brush ForegroundMouseOver
        {
            get { return (Brush)GetValue(ForegroundMouseOverProperty); }
            set { SetValue(ForegroundMouseOverProperty, value); }
        }
        public Brush ForegroundPressed
        {
            get { return (Brush)GetValue(ForegroundPressedProperty); }
            set { SetValue(ForegroundPressedProperty, value); }
        }

        public object Icon
        {
            get { return (object)GetValue(IconProperty); }
            set { SetValue(IconProperty, value); }
        }

        public object IconMouseOver
        {
            get { return (object)GetValue(IconMouseOverProperty); }
            set { SetValue(IconMouseOverProperty, value); }
        }

        public object IconPressed
        {
            get { return (object)GetValue(IconPressedProperty); }
            set { SetValue(IconPressedProperty, value); }
        }
        #endregion

        #region Constructors
        static ElButton()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(ElButton), new FrameworkPropertyMetadata(typeof(ElButton)));
        }
        #endregion
    }
}
